package com.cjkj.purchase.service.impl;

import java.util.List;
import com.cjkj.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cjkj.purchase.mapper.PurchaseStorageRecordMapper;
import com.cjkj.purchase.domain.PurchaseStorageRecord;
import com.cjkj.purchase.service.IPurchaseStorageRecordService;

/**
 * 采购材料入库记录Service业务层处理
 * 
 * @author cjkj
 * @date 2025-02-20
 */
@Service
public class PurchaseStorageRecordServiceImpl implements IPurchaseStorageRecordService 
{
    @Resource
    private PurchaseStorageRecordMapper purchaseStorageRecordMapper;

    /**
     * 查询采购材料入库记录
     * 
     * @param recordId 采购材料入库记录主键
     * @return 采购材料入库记录
     */
    @Override
    public PurchaseStorageRecord selectPurchaseStorageRecordByRecordId(Long recordId)
    {
        return purchaseStorageRecordMapper.selectPurchaseStorageRecordByRecordId(recordId);
    }

    /**
     * 查询采购材料入库记录列表
     * 
     * @param purchaseStorageRecord 采购材料入库记录
     * @return 采购材料入库记录
     */
    @Override
    public List<PurchaseStorageRecord> selectPurchaseStorageRecordList(PurchaseStorageRecord purchaseStorageRecord)
    {
        return purchaseStorageRecordMapper.selectPurchaseStorageRecordList(purchaseStorageRecord);
    }

    /**
     * 新增采购材料入库记录
     * 
     * @param purchaseStorageRecord 采购材料入库记录
     * @return 结果
     */
    @Override
    public int insertPurchaseStorageRecord(PurchaseStorageRecord purchaseStorageRecord)
    {
        purchaseStorageRecord.setCreateTime(DateUtils.getNowDate());
        return purchaseStorageRecordMapper.insertPurchaseStorageRecord(purchaseStorageRecord);
    }

    /**
     * 修改采购材料入库记录
     * 
     * @param purchaseStorageRecord 采购材料入库记录
     * @return 结果
     */
    @Override
    public int updatePurchaseStorageRecord(PurchaseStorageRecord purchaseStorageRecord)
    {
        purchaseStorageRecord.setUpdateTime(DateUtils.getNowDate());
        return purchaseStorageRecordMapper.updatePurchaseStorageRecord(purchaseStorageRecord);
    }

    /**
     * 批量删除采购材料入库记录
     * 
     * @param recordIds 需要删除的采购材料入库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseStorageRecordByRecordIds(Long[] recordIds)
    {
        return purchaseStorageRecordMapper.deletePurchaseStorageRecordByRecordIds(recordIds);
    }

    /**
     * 删除采购材料入库记录信息
     * 
     * @param recordId 采购材料入库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseStorageRecordByRecordId(Long recordId)
    {
        return purchaseStorageRecordMapper.deletePurchaseStorageRecordByRecordId(recordId);
    }
}
